﻿/** * com.sekati.net.ExpressInstall * @version 1.1.0 * @author jason m horwitz | sekati.com * Copyright (c) 2007  jason m horwitz | Sekat LLC. All Rights Reserved. * Released under the MIT License: http://www.opensource.org/licenses/mit-license.php */ import com.sekati.core.FWDepth;import com.sekati.events.Event;import com.sekati.events.Dispatcher;
/** * This class invokes the Adobe  Flash Player Express Install functionality if an update is required. * {@code Flash Usage: * // first line of code in your fla (before preloader)  * var expressinstall:ExpressInstall = new ExpressInstall(); * } * {@code swfIN Usage: * <script type="text/javascript">  * 	var f = new swfIN("foo.swf", "foo", "640", "480");  * 	f.useExpressInstall(); * 	f.detect(9, "d", "no_flash"); * 	f.write(); * </script> * } * Note: Your Flash movie must be at least 214px by 137px in order to use ExpressInstall. */class com.sekati.net.ExpressInstall {
	private var _this:ExpressInstall;	private var _updater:MovieClip;	private var _holder:MovieClip;
	/**	 * Constructor checks flash player version and stops movie to	 * invokes Express Install if update is required.	 */	public function ExpressInstall() {		_this = this;		if (_root.MMplayerType != undefined)  loadUpdater( );	}
	private function loadUpdater():Void {		_root.stop( );		System.security.allowDomain( "fpdownload.macromedia.com" );		_updater = _root.createEmptyMovieClip( "expressInstallHolder", FWDepth.ExpressInstall );		// register the callback so we know if they cancel or there is an error		_updater.installStatus = onInstallStatus;		_holder = _updater.createEmptyMovieClip( "_holder", 1 );		// can't use movieClipLoader because it has to work in 6.0.65		_updater.onEnterFrame = function ():Void {			if (typeof _holder.startUpdate == 'function') {				_this.initUpdater( );				_updater.onEnterFrame = null;			}		};		_holder.loadMovie( "http://fpdownload.macromedia.com/pub/flashplayer/" + "update/current/swf/autoUpdater.swf?" + Math.random( ) );	}
	private function initUpdater():Void {		_holder.redirectURL = _level0.MMredirectURL;		_holder.MMplayerType = _level0.MMplayerType;		_holder.MMdoctitle = _level0.MMdoctitle;		_holder.startUpdate( );	}
	/**	 * onInstallStatus event handler method	 * @param msg (String) status message	 * @return Void	 */	public function onInstallStatus(msg:String):Void {		Dispatcher.$.dispatchEvent( new Event( "ExpressInstall_onInstallStatus", this, {message:msg} ) );	}}